#ifndef CONSOLE_H
#define CONSOLE_H
#include "common.h"
#include "controller.h"
#include "document.h"
#include "argument.h"
#include "statusbar.h"

extern const int controllernum;

class Console
{
private:
	Controller *controllers[controllernum];
	Controller *activeController;
	Document *document;
	
	WINDOW *window;
	Statusbar *status;
protected:
	void initialize();
public:
	Console();
	~Console();
	
	void start(Argument *arg);
	void postQuite();
	
	chtype getMessage();
	bool isQuitMessage(chtype message);

	bool update();

	Controller *getInsertController();
	Controller *getCommandController();
	Controller *getLineController();

	void setController(Controller *controller);
	
	WINDOW *getWindow();
	Statusbar *getStatusbar();
	
	void bindDocument(Document *doc);
};

#endif//CONSOLE_H

